package com.zdd.ehe.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @version 1.0.0
 * @title: MyBatisConfig
 * @author: HFLy
 * @description: MyBatis-Plus 配置类
 * @date: 12/9/2022 下午8:53
 */
@Configuration
@MapperScan("com.zdd.ehe.mapper")
public class MyBatisConfig {
    /**
     * @description: 分页插件
     * @return: com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
     * @author: HFly
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return mybatisPlusInterceptor;
    }
}
